package com.cbn.ibcp.web.jishiting.operator.convert;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.cbn.ibcp.common.utils.bean.BeanUtils;
import com.cbn.ibcp.jishiting.rms.bo.ResourceStreamBO;
import com.cbn.ibcp.jishiting.rms.bo.ResourceStreamOrgBO;
import com.cbn.ibcp.web.jishiting.operator.vo.ResourceStreamOrgVO;
import com.cbn.ibcp.web.jishiting.operator.vo.ResourceStreamVO;

public class ResourceStreamOrgBOConvert {

    public static ResourceStreamOrgVO convertToResourceStreamOrgVO(ResourceStreamOrgBO resourceStreamOrgBO) {
        if (resourceStreamOrgBO == null) {
            return null;
        }
        ResourceStreamOrgVO resourceStreamOrgVO = new ResourceStreamOrgVO();
        BeanUtils.copyBeanProp(resourceStreamOrgVO, resourceStreamOrgBO);
        resourceStreamOrgVO.setEpisodeId(StrUtil.toStringOrNull(resourceStreamOrgBO.getEpisodeId()));
        resourceStreamOrgVO.setEpisodeName(resourceStreamOrgBO.getEpisodeName());
        resourceStreamOrgVO.setAlbumId(StrUtil.toStringOrNull(resourceStreamOrgBO.getAlbumId()));
        resourceStreamOrgVO.setAlbumName(StrUtil.toStringOrNull(resourceStreamOrgBO.getAlbumName()));
        resourceStreamOrgVO.setAlbumCpStatus(resourceStreamOrgBO.getAlbumCpStatus());
        resourceStreamOrgVO.setEpisodeCpStatus(resourceStreamOrgBO.getEpisodeCpStatus());
        resourceStreamOrgVO.setCreateTime(DateUtil.format(resourceStreamOrgBO.getCreateTime(), DatePattern.NORM_DATETIME_PATTERN));
        resourceStreamOrgVO.setUpdateTime(DateUtil.format(resourceStreamOrgBO.getUpdateTime(), DatePattern.NORM_DATETIME_PATTERN));
        return resourceStreamOrgVO;
    }
}
